import http from '@/axios/http.js';
import baseUrl from '@/constant/index/apiUrl.js';
// import mock from '@/mock/api/modelEvaluating/data.js';

const env = import.meta.env.VITE_MODE_NAME;

export default {
	//购物车列表
	getCartList(uid){
		if (env == 'development') {
			return http.get(import.meta.env.VITE_API_URL_GATEWAY + baseUrl.cart + uid);
		} else if (env == 'test') {
			return http.get(import.meta.env.VITE_API_URL_HOME + baseUrl.cart + uid);
		}
	},
	//购物车中选中并结算的商品
	saveGoodsList(uid,detailInfo){
		if (env == 'development') {
			return http.post(import.meta.env.VITE_API_URL_GATEWAY + baseUrl.saveGoods + uid,detailInfo);
		} else if (env == 'test') {
			return http.post(import.meta.env.VITE_API_URL_PAYMENT + baseUrl.saveGoods + uid,detailInfo);
		}
	},
	//删除购物车商品
	deleteGood(uid,cid){
		if (env == 'development') {
			return http.delete(import.meta.env.VITE_API_URL_GATEWAY + baseUrl.deleteGood + uid + '/' + cid);
		}
		else if (env == 'test') {
			return http.delete(import.meta.env.VITE_API_URL_HOME + baseUrl.deleteGood + uid + '/' + cid);
		}
	}
}
